#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <ctype.h>

#define MAXSIZE 128
#define INFINITY 1e10

typedef struct SNode* PtrToSNode;
typedef double ElementType;
struct SNode {
    ElementType Data;
    PtrToSNode Next;
};
typedef PtrToSNode Stack;
typedef enum { num, opt, end } Type;

Stack CreateStack () {
    Stack S = (Stack)malloc(sizeof(struct SNode));
    S->Next = NULL;
    return S;
}

bool Push ( Stack S, ElementType X ) {
    Stack tmp = (Stack)malloc(sizeof(struct SNode));
    tmp->Data = X;
    tmp->Next = S->Next;
    S->Next = tmp;
    return true;
}

bool StackEmpty ( Stack S ) {
    return ( S->Next == NULL );
}

ElementType Pop ( Stack S ) {
    if ( StackEmpty(S) ) {
        printf("Empty\n");
        exit(-1);
    }
    PtrToSNode tmp = S->Next;
    ElementType X = tmp->Data;
    S->Next = tmp->Next;
    free(tmp);
    return X;
}

Type GetOp ( char* Expr, int* start, char* str ) {
    int i = 0;
    while ( (str[0] = Expr[(*start)++]) == ' ' );
    while ( str[i] != ' ' && str[i] != '\0' ) {
        str[++i] = Expr[(*start)++];
    }
    if ( isdigit(str[0]) || isdigit(str[1]) )    return num;
    else if ( i == 0 ) return end;
    else return opt;
}

ElementType PostfitExp ( char* Expr ) {
    int start = 0;
    char str[MAXSIZE] = {0};
    Type T;
    Stack S;
    ElementType Op1, Op2, result;
    while ( (T = GetOp(Expr,&start,str)) != end ) {
        if ( T == num ) Push(S,atof(str));
        else {
            if ( !StackEmpty(S) ) Op1 = Pop(S);
            else return INFINITY;
            if ( !StackEmpty(S) ) Op2 = Pop(S);
            else return INFINITY;
                switch (str[0]) {
                case '+': 
                    Push(S,Op1+Op2);
                    break;
                case '-' :
                    Push(S,Op1-Op2);
                    break;
                case '*' :
                    Push(S,Op1*Op2);
                    break;
                case '/' :
                    if ( Op2 >= -1e-10 && Op2 <= 1e-10 ) {
                        printf("Err while Dividing\n");
                        return INFINITY;
                    }
                    Push(S,Op1/Op2);
                    break;
                default:
                    printf("Err opt\n");
                    return INFINITY;
                    break;
                }
            
        }
    }
    if ( !StackEmpty(S) ) return Pop(S);
    else return INFINITY;
}

int main () {
    char Expr[MAXSIZE] = {0};
    gets(Expr);
    ElementType result = PostfitExp(Expr);
    if ( result == INFINITY ) printf("Err Expression\n");
    else printf("%.4f",result);
    return 0;
}